package com.evil.application.pojo.dto.form;

import com.alibaba.fastjson.annotation.JSONField;
import com.evil.application.pojo.dto.form.control.code.ControlDTO;
import com.evil.common.application.dto.form.ApplicationFormDTO;
import com.evil.common.application.enums.PublishStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * 应用表单信息 返回实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ApplicationFormControlRespDTO extends ApplicationFormDTO {

    /**
     * 控件列表（数据转换）
     */
    @JSONField(serialize = false)
    private List<ControlDTO> controlsData;

    /**
     * 控件列表（前端使用）
     */
    private List<?> controls;

    /**
     * 发布状态{@link PublishStatusEnum}
     */
    private Integer publishStatus;

    public ApplicationFormControlRespDTO() {
        this.controlsData = new ArrayList<>();
        this.controls = new ArrayList<>();
    }

    public List<?> getControls() {
        return controlsData;
    }

    private void setControls(List<?> controls) {
        this.controls = controls;
    }
}
